import axios from "axios";
// import router from "../router";
import GLOBALS from "../../../components/global_gj";
axios.defaults.withCredentials = true; // 允许请求的时候携带认证

// 联合告警

// 联合告警事件
export const getEvents = data =>
  axios({
    // 查询页面
    url: GLOBALS.serverSrc + "/getTotalEvents",
    method: "post",
    data
  });

// 查询图表
export const getEchart = data =>
  axios({
    url: GLOBALS.serverSrc + "/getCpuIndicators", // cpu
    method: "post",
    data
  });
// 系统名称查询
export const getSystem = data =>
  axios({
    url: GLOBALS.serverSrc + "/getAlarmEventInfo", // 系统事件查询
    method: "post",
    data
  });
// 系统查询2
export const getSystemT = data =>
  axios({
    url: GLOBALS.serverSrc + "/getAlarmEventInfo", // 系统名称查询
    method: "post",
    data
  });

// 查询传参数
export const getSystemQuery = data =>
  axios({
    url: GLOBALS.serverSrc + "/getAlarmEventInfo" + "?eventName=" + data,
    method: "post"
  });

export const getDetails = data =>
  axios({
    url: GLOBALS.serverSrc + "/getSystemInfoDetailById", // 系统名称查询
    method: "post",
    data
  });

// 关联查询
export const getSystemInfoByIp = data =>
  axios({
    url: GLOBALS.serverSrc + "/getSystemInfoByIp" + "?ip=" + data,
    method: "post"
  });

// 推送平台
export const getDSystemIds = data =>
  axios({
    url: GLOBALS.serverSrc + "/getSystemInfoById" + "?systemId=" + data, // 系统名称查询
    method: "get",
    data
  });

// 树形图
export const getTree = data =>
  axios({
    url: GLOBALS.serverSrc + "/getServiceRelevanceIp",
    method: "post",
    data
  });

// 查询
export const getCause = data =>
  axios({
    url: GLOBALS.serverSrc + "/RegistrationController/cause", // 部署到测试环境地址
    method: "post",
    data
  });
// 添加
export const getAdd = data =>
  axios({
    url: GLOBALS.serverSrc + "/RegistrationController/add", // 部署到测试环境地址
    method: "post",
    data
  });

// sjxqFive的接口
export const getSystemInfoFiveById = data =>
  axios({
    url: GLOBALS.serverSrc + "/getSystemInfoFiveById", // 部署到测试环境地址
    method: "post",
    data
  });

export const getIndexName = data =>
  axios({
    url: GLOBALS.serverSrc + "/getIndexName", // 部署到测试环境地址
    method: "post",
    data
  });

// 异常URL与大文件的接口
export const UrlDatas = data =>
  axios({
    url: "http://66.2.41.57:9081/exceptionUrl/exceptionUrl/list", // 测试地址xxxxxx
    // url: "http://66.0.44.83:9081/exceptionUrl/exceptionUrl/list", // 生产地址
    method: "post",
    data
  });
